# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=param
pkgname=python-${_pkg}
pkgver=1.13.0
pkgrel=2
pkgdesc="Make your Python code clearer and more reliable by declaring Parameters"
arch=(any)
url="https://param.holoviz.org/"
license=(BSD)
depends=(python)
makedepends=(python-setuptools)
checkdepends=(python-pytest python-jsonschema python-numpy python-pandas ipython)
# No tests in Pypi tarballs
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(https://github.com/holoviz/param/archive/v${pkgver}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('ab195ed7fd61f935b1be302dc8a2e43b5b297e30e0a4fc5911dcd15485a0aa3e')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}-${pkgver}
  PARAM_TEST_JSONSCHEMA=1 PARAM_TEST_NUMPY=1 PARAM_TEST_PANDAS=1 PARAM_TEST_IPYTHON=1 pytest tests -vv --color=yes
}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
